﻿using _02.简单工厂模式.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _02.简单工厂模式
{
    internal class Program
    {
        static void Main(string[] args)
        {
            /*var apple = FruitFactory.Create("Apple");
            var banana = FruitFactory.Create("Banana");
            var orange = FruitFactory.Create("Orange");*/

            var apple = FruitFactory.Create<Apple>();
            var banana = FruitFactory.Create<Banana>();
            var orange = FruitFactory.Create<Orange>();

            apple.Plant(10);
            apple.Grow(180);
            Console.WriteLine($"苹果收获:{apple.Harvest()}");

            banana.Plant(10);
            banana.Grow(180);
            Console.WriteLine($"香蕉收获:{banana.Harvest()}");

            orange.Plant(10);
            orange.Grow(180);
            Console.WriteLine($"柑橘收获:{orange.Harvest()}");

            Console.ReadKey();
        }
    }
}
